home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Interfaces / Universal Interfaces 2.0a3 / Universal AIncludes / Speech.a < prev    next >
Encoding:
Text File  |  1994-11-11  |  7.6 KB  |  480 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Speech.a
  3. ;
  4. ;    Copyright:    © 1984-1994 by Apple Computer, Inc.
  5. ;                All rights reserved.
  6. ;
  7. ;    Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8. ;
  9. ;    Bugs?:        If you find a problem with this file, send the file and version
  10. ;                information (from above) and the problem description to:
  11. ;
  12. ;                    Internet:    apple.bugs@applelink.apple.com
  13. ;                    AppleLink:    APPLE.BUGS
  14. ;
  15. ;
  16.  
  17.     IF &TYPE('__SPEECH__') = 'UNDEFINED' THEN
  18. __SPEECH__ SET 1
  19.  
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24. ;        include 'ConditionalMacros.a'                                ;
  25.  
  26.     IF &TYPE('__MEMORY__') = 'UNDEFINED' THEN
  27.     include 'Memory.a'
  28.     ENDIF
  29. ;        include 'MixedMode.a'                                        ;
  30.  
  31.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  32.     include 'Files.a'
  33.     ENDIF
  34. ;        include 'OSUtils.a'                                        ;
  35.  
  36. kTextToSpeechSynthType            EQU        'ttsc'
  37. kTextToSpeechVoiceType            EQU        'ttvd'
  38. kTextToSpeechVoiceFileType        EQU        'ttvf'
  39. kTextToSpeechVoiceBundleType    EQU        'ttvb'
  40.  
  41. kNoEndingProsody                EQU        1
  42. kNoSpeechInterrupt                EQU        2
  43. kPreflightThenPause                EQU        4
  44.  
  45. kImmediate                        EQU        0
  46. kEndOfWord                        EQU        1
  47. kEndOfSentence                    EQU        2
  48.  
  49. ;------------------------------------------
  50. ; GetSpeechInfo & SetSpeechInfo selectors    
  51. ;------------------------------------------
  52. soStatus                        EQU        'stat'
  53. soErrors                        EQU        'erro'
  54. soInputMode                        EQU        'inpt'
  55. soCharacterMode                    EQU        'char'
  56. soNumberMode                    EQU        'nmbr'
  57. soRate                            EQU        'rate'
  58. soPitchBase                        EQU        'pbas'
  59. soPitchMod                        EQU        'pmod'
  60. soVolume                        EQU        'volm'
  61. soSynthType                        EQU        'vers'
  62. soRecentSync                    EQU        'sync'
  63. soPhonemeSymbols                EQU        'phsy'
  64. soCurrentVoice                    EQU        'cvox'
  65. soCommandDelimiter                EQU        'dlim'
  66. soReset                            EQU        'rset'
  67. soCurrentA5                        EQU        'myA5'
  68. soRefCon                        EQU        'refc'
  69. soTextDoneCallBack                EQU        'tdcb'
  70. soSpeechDoneCallBack            EQU        'sdcb'
  71. soSyncCallBack                    EQU        'sycb'
  72. soErrorCallBack                    EQU        'ercb'
  73. soPhonemeCallBack                EQU        'phcb'
  74. soWordCallBack                    EQU        'wdcb'
  75. soSynthExtension                EQU        'xtnd'
  76. soSoundOutput                    EQU        'sndo'
  77.  
  78. ;------------------------------------------
  79. ; Speaking Mode Constants                     
  80. ;------------------------------------------
  81. modeText                        EQU        'TEXT'                ; input mode constants                     
  82. modePhonemes                    EQU        'PHON'
  83. modeNormal                        EQU        'NORM'                ; character mode and number mode constants 
  84. modeLiteral                        EQU        'LTRL'
  85.  
  86. soVoiceDescription                EQU        'info'
  87. soVoiceFile                        EQU        'fref'
  88.  
  89. SpeechChannelRecord     RECORD    0
  90. data                     ds.l    1
  91. sizeof                     EQU    4
  92.                         ENDR
  93.  
  94. VoiceSpec                 RECORD    0
  95. creator                     ds.l    1
  96. id                         ds.l    1
  97. sizeof                     EQU    8
  98.                         ENDR
  99.  
  100.  
  101. kNeuter                            EQU        0
  102. kMale                            EQU        1
  103. kFemale                            EQU        2
  104.  
  105. VoiceDescription         RECORD    0
  106. length                     ds.l    1
  107. voice                     ds        VoiceSpec
  108. version                     ds.l    1
  109. name                     ds.l    16
  110. comment                     ds.l    64
  111. gender                     ds.w    1
  112. age                         ds.w    1
  113. script                     ds.w    1
  114. language                 ds.w    1
  115. region                     ds.w    1
  116. reserved                 ds.l    4
  117. sizeof                     EQU    362
  118.                         ENDR
  119.  
  120. VoiceFileInfo             RECORD    0
  121. fileSpec                 ds        FSSpec
  122. resID                     ds.w    1
  123. sizeof                     EQU    72
  124.                         ENDR
  125.  
  126. SpeechStatusInfo         RECORD    0
  127. outputBusy                 ds.b    1
  128. outputPaused             ds.b    1
  129. inputBytesLeft             ds.l    1
  130. phonemeCode                 ds.w    1
  131. sizeof                     EQU    8
  132.                         ENDR
  133.  
  134. SpeechErrorInfo         RECORD    0
  135. count                     ds.w    1
  136. oldest                     ds.w    1
  137. oldPos                     ds.l    1
  138. newest                     ds.w    1
  139. newPos                     ds.l    1
  140. sizeof                     EQU    14
  141.                         ENDR
  142.  
  143. SpeechVersionInfo         RECORD    0
  144. synthType                 ds.l    1
  145. synthSubType             ds.l    1
  146. synthManufacturer         ds.l    1
  147. synthFlags                 ds.l    1
  148. synthVersion             ds        NumVersion
  149. sizeof                     EQU    20
  150.                         ENDR
  151.  
  152. PhonemeInfo             RECORD    0
  153. opcode                     ds.w    1
  154. phStr                     ds.l    4
  155. exampleStr                 ds.l    8
  156. hiliteStart                 ds.w    1
  157. hiliteEnd                 ds.w    1
  158. sizeof                     EQU    54
  159.                         ENDR
  160.  
  161. PhonemeDescriptor         RECORD    0
  162. phonemeCount             ds.w    1
  163. thePhonemes                 ds        PhonemeInfo
  164. sizeof                     EQU    56
  165.                         ENDR
  166.  
  167. SpeechXtndData             RECORD    0
  168. synthCreator             ds.l    1
  169. synthData                 ds.b    2
  170. sizeof                     EQU    6
  171.                         ENDR
  172.  
  173. DelimiterInfo             RECORD    0
  174. startDelimiter             ds.b    2
  175. endDelimiter             ds.b    2
  176. sizeof                     EQU    4
  177.                         ENDR
  178.  
  179.     IF GENERATING68K THEN
  180.         Macro
  181.         _SpeechManagerVersion
  182.             dc.w     $203C
  183.             dc.w     $0000
  184.             dc.w     $000C
  185.             dc.w     $A800
  186.         EndM
  187.     ELSE
  188.         IMPORT    SpeechManagerVersion
  189.     ENDIF
  190.  
  191.     IF GENERATING68K THEN
  192.         Macro
  193.         _MakeVoiceSpec
  194.             dc.w     $203C
  195.             dc.w     $0604
  196.             dc.w     $000C
  197.             dc.w     $A800
  198.         EndM
  199.     ELSE
  200.         IMPORT    MakeVoiceSpec
  201.     ENDIF
  202.  
  203.     IF GENERATING68K THEN
  204.         Macro
  205.         _CountVoices
  206.             dc.w     $203C
  207.             dc.w     $0108
  208.             dc.w     $000C
  209.             dc.w     $A800
  210.         EndM
  211.     ELSE
  212.         IMPORT    CountVoices
  213.     ENDIF
  214.  
  215.     IF GENERATING68K THEN
  216.         Macro
  217.         _GetIndVoice
  218.             dc.w     $203C
  219.             dc.w     $030C
  220.             dc.w     $000C
  221.             dc.w     $A800
  222.         EndM
  223.     ELSE
  224.         IMPORT    GetIndVoice
  225.     ENDIF
  226.  
  227.     IF GENERATING68K THEN
  228.         Macro
  229.         _GetVoiceDescription
  230.             dc.w     $203C
  231.             dc.w     $0610
  232.             dc.w     $000C
  233.             dc.w     $A800
  234.         EndM
  235.     ELSE
  236.         IMPORT    GetVoiceDescription
  237.     ENDIF
  238.  
  239.     IF GENERATING68K THEN
  240.         Macro
  241.         _GetVoiceInfo
  242.             dc.w     $203C
  243.             dc.w     $0614
  244.             dc.w     $000C
  245.             dc.w     $A800
  246.         EndM
  247.     ELSE
  248.         IMPORT    GetVoiceInfo
  249.     ENDIF
  250.  
  251.     IF GENERATING68K THEN
  252.         Macro
  253.         _NewSpeechChannel
  254.             dc.w     $203C
  255.             dc.w     $0418
  256.             dc.w     $000C
  257.             dc.w     $A800
  258.         EndM
  259.     ELSE
  260.         IMPORT    NewSpeechChannel
  261.     ENDIF
  262.  
  263.     IF GENERATING68K THEN
  264.         Macro
  265.         _DisposeSpeechChannel
  266.             dc.w     $203C
  267.             dc.w     $021C
  268.             dc.w     $000C
  269.             dc.w     $A800
  270.         EndM
  271.     ELSE
  272.         IMPORT    DisposeSpeechChannel
  273.     ENDIF
  274.  
  275.     IF GENERATING68K THEN
  276.         Macro
  277.         _SpeakString
  278.             dc.w     $203C
  279.             dc.w     $0220
  280.             dc.w     $000C
  281.             dc.w     $A800
  282.         EndM
  283.     ELSE
  284.         IMPORT    SpeakString
  285.     ENDIF
  286.  
  287.     IF GENERATING68K THEN
  288.         Macro
  289.         _SpeakText
  290.             dc.w     $203C
  291.             dc.w     $0624
  292.             dc.w     $000C
  293.             dc.w     $A800
  294.         EndM
  295.     ELSE
  296.         IMPORT    SpeakText
  297.     ENDIF
  298.  
  299.     IF GENERATING68K THEN
  300.         Macro
  301.         _SpeakBuffer
  302.             dc.w     $203C
  303.             dc.w     $0828
  304.             dc.w     $000C
  305.             dc.w     $A800
  306.         EndM
  307.     ELSE
  308.         IMPORT    SpeakBuffer
  309.     ENDIF
  310.  
  311.     IF GENERATING68K THEN
  312.         Macro
  313.         _StopSpeech
  314.             dc.w     $203C
  315.             dc.w     $022C
  316.             dc.w     $000C
  317.             dc.w     $A800
  318.         EndM
  319.     ELSE
  320.         IMPORT    StopSpeech
  321.     ENDIF
  322.  
  323.     IF GENERATING68K THEN
  324.         Macro
  325.         _StopSpeechAt
  326.             dc.w     $203C
  327.             dc.w     $0430
  328.             dc.w     $000C
  329.             dc.w     $A800
  330.         EndM
  331.     ELSE
  332.         IMPORT    StopSpeechAt
  333.     ENDIF
  334.  
  335.     IF GENERATING68K THEN
  336.         Macro
  337.         _PauseSpeechAt
  338.             dc.w     $203C
  339.             dc.w     $0434
  340.             dc.w     $000C
  341.             dc.w     $A800
  342.         EndM
  343.     ELSE
  344.         IMPORT    PauseSpeechAt
  345.     ENDIF
  346.  
  347.     IF GENERATING68K THEN
  348.         Macro
  349.         _ContinueSpeech
  350.             dc.w     $203C
  351.             dc.w     $0238
  352.             dc.w     $000C
  353.             dc.w     $A800
  354.         EndM
  355.     ELSE
  356.         IMPORT    ContinueSpeech
  357.     ENDIF
  358.  
  359.     IF GENERATING68K THEN
  360.         Macro
  361.         _SpeechBusy
  362.             dc.w     $203C
  363.             dc.w     $003C
  364.             dc.w     $000C
  365.             dc.w     $A800
  366.         EndM
  367.     ELSE
  368.         IMPORT    SpeechBusy
  369.     ENDIF
  370.  
  371.     IF GENERATING68K THEN
  372.         Macro
  373.         _SpeechBusySystemWide
  374.             dc.w     $203C
  375.             dc.w     $0040
  376.             dc.w     $000C
  377.             dc.w     $A800
  378.         EndM
  379.     ELSE
  380.         IMPORT    SpeechBusySystemWide
  381.     ENDIF
  382.  
  383.     IF GENERATING68K THEN
  384.         Macro
  385.         _SetSpeechRate
  386.             dc.w     $203C
  387.             dc.w     $0444
  388.             dc.w     $000C
  389.             dc.w     $A800
  390.         EndM
  391.     ELSE
  392.         IMPORT    SetSpeechRate
  393.     ENDIF
  394.  
  395.     IF GENERATING68K THEN
  396.         Macro
  397.         _GetSpeechRate
  398.             dc.w     $203C
  399.             dc.w     $0448
  400.             dc.w     $000C
  401.             dc.w     $A800
  402.         EndM
  403.     ELSE
  404.         IMPORT    GetSpeechRate
  405.     ENDIF
  406.  
  407.     IF GENERATING68K THEN
  408.         Macro
  409.         _SetSpeechPitch
  410.             dc.w     $203C
  411.             dc.w     $044C
  412.             dc.w     $000C
  413.             dc.w     $A800
  414.         EndM
  415.     ELSE
  416.         IMPORT    SetSpeechPitch
  417.     ENDIF
  418.  
  419.     IF GENERATING68K THEN
  420.         Macro
  421.         _GetSpeechPitch
  422.             dc.w     $203C
  423.             dc.w     $0450
  424.             dc.w     $000C
  425.             dc.w     $A800
  426.         EndM
  427.     ELSE
  428.         IMPORT    GetSpeechPitch
  429.     ENDIF
  430.  
  431.     IF GENERATING68K THEN
  432.         Macro
  433.         _SetSpeechInfo
  434.             dc.w     $203C
  435.             dc.w     $0654
  436.             dc.w     $000C
  437.             dc.w     $A800
  438.         EndM
  439.     ELSE
  440.         IMPORT    SetSpeechInfo
  441.     ENDIF
  442.  
  443.     IF GENERATING68K THEN
  444.         Macro
  445.         _GetSpeechInfo
  446.             dc.w     $203C
  447.             dc.w     $0658
  448.             dc.w     $000C
  449.             dc.w     $A800
  450.         EndM
  451.     ELSE
  452.         IMPORT    GetSpeechInfo
  453.     ENDIF
  454.  
  455.     IF GENERATING68K THEN
  456.         Macro
  457.         _TextToPhonemes
  458.             dc.w     $203C
  459.             dc.w     $0A5C
  460.             dc.w     $000C
  461.             dc.w     $A800
  462.         EndM
  463.     ELSE
  464.         IMPORT    TextToPhonemes
  465.     ENDIF
  466.  
  467.     IF GENERATING68K THEN
  468.         Macro
  469.         _UseDictionary
  470.             dc.w     $203C
  471.             dc.w     $0460
  472.             dc.w     $000C
  473.             dc.w     $A800
  474.         EndM
  475.     ELSE
  476.         IMPORT    UseDictionary
  477.     ENDIF
  478.  
  479.     ENDIF ; __SPEECH__
  480.